
<?php Yii::app()->clientScript->registerScript('employeecontact',<<<HERE
    var empno= '$employee->empno';
    Ext.onReady(function(){
        var empContact=Ext.create('Ext.data.Store',{
            model:'Employeecontacts',
            pageSize:20,
            autoLoad:true,
            proxy:{
                type:'ajax',
                url:'index.php?r=employeecontacts/list&empno='+empno,
                reader:{
                    type:'json',
                    root:'data',
                    totalProperty:'totalCount'
                }
            }
        })
        Ext.create('Ext.ux.LiveSearchGridPanel',{
            store:empContact,
            height: 450,
            width: grid_width,
            title: 'Contact List',
            renderTo: 'contact-list',
            viewConfig: {
                stripeRows: true
            },
          
            bbar: new Ext.PagingToolbar({
                pageSize: 20,
                store:empContact,
                displayInfo: true,
                displayMsg: 'Displaying topics {0} - {1} of {2}',
                emptyMsg: 'No topics to display'

            }),
            columns:[
                {
                    text:'Contact',
                    flex:1,
                    dataIndex:'contactname'
                },
                {
                    text:'Email',
                    flex:1,
                    dataIndex:'email'
                },
                {
                    text:'Phone work',
                    flex:1,
                    dataIndex:'phonework'
                },
                {
                    text:'Work Extention',
                    flex:1,
                    dataIndex:'workextention'
                },
                {
                    text:'Phone Home',
                    flex:1,
                    dataIndex:'phonehome'

                },
                {
                    text:'Phone mobile',
                    flex:1,
                    dataIndex:'phonemobile'
                },
                {
                    text:'Salutation',
                    flex:1,
                    dataIndex:'salutation'
                },
                {
                    text:'Title',
                    flex:1,
                    dataIndex:'title'
                },
                {
                    text:'Actions',
                    flex:1,
                    renderer:function(value,p,record){
                        return Ext.String.format('<a href="index.php?r=Employeecontacts/update&id={0}"><img src="images/update.png"/></a>                                                <a href="index.php?r=Employeecontacts/delete&id={0}"><img src="images/delete.png"/></a>',record.data.id);
                    }
                }
            ]

        });
    });
HERE
        ,CClientScript::POS_BEGIN);?>


<div id="left-col">
    <?php $this->renderPartial('_side',array(
        'employee'=>$employee
    ));?>
</div>

<div id="right-col">

    <div class="wrap">
        <div class="container">

            
            <div id="breadcrumb" style="display:none;"><span style="padding-left:10px;font-size:10px;color:#777777;" id="alsoviewing"></span></div>
            <div class="inside">
                <?php $this->renderPartial('/employees/_view',array(
                    'model'=>$employee,
                ));?>
              
               
                <?php $this->renderPartial('/employees/_tab',array(
                    'model'=>$employee,
                ));?>
                 <br/>
       
                <div id="contact-list"></div>


                
            </div><!-- inside -->
        </div><!-- container -->
    </div><!-- wrap -->
    <?php $this->renderPartial('/copyright'); ?>
</div> <!-- left-col -->